{% extends "base.html" %}

{% load i18n page_metadata_tags %}

{% block metadata %}
    {% translate "Packages" as trans_title %}
    {% page_metadata page_title=trans_title %}
{% endblock metadata %}

{% block body %}
    <div class="row">
        <div class="col-xs-12">
            <h2>{% translate "Latest 50 packages added" %}</h2>
            {% if request.user.is_authenticated %}
                {% if profile.can_add_package %}
                    <p><a class="btn btn-primary" href="{% url 'add_package' %}">{% translate "Add a new package!" %}</a></p>
                {% endif %}
            {% endif %}
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="list-group">
                {% for package in latest %}
                    {% include "package/includes/_package.html" %}
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock body %}
